﻿using Awsc.DataAcquisitionSys.Core.DataAcquisition;

namespace Awsc.DataAcquisitionSys.Api.Models
{
    public class SensorDataResponse
    {
        public int SensorCount { get
            {
                var result = 0;
                foreach (var item in NamedSensorDataCollections)
                {
                    result += item.SensorCount;
                }
                return result;
            } }
        public List<NamedSensorDataCollection> NamedSensorDataCollections { get; set; } = new List<NamedSensorDataCollection>();

    }

    public class NamedSensorDataCollection
    {
        public NamedSensorDataCollection()
        {

        }
        public NamedSensorDataCollection(string categoryName)
        {
            CategoryName = categoryName;
        }
        public string CategoryName { get; set; }
        public int SensorCount
        {
            get
            {
                return Sensors?.Count ?? 0;
            }
        }
        public List<SensorData> Sensors { get; set; } = new List<SensorData>();
    }

}
